<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>main Page</title>
<script type="text/javascript" src="/js/jquery-1.3.1.js"></script>
<script type="text/javascript">
$(function(){
	$("#h21").html("welcome to ajaxDemo");
});
function ajaxTest1(){
	//http://www.cnblogs.com/tylerdonet/p/3520862.html
	//ajax的参数在这个链接里面
	$.ajax({
        type: "GET",
        url: "/demo/ajaxTest1.do",
        data: {username:'xiaoming小明', content:'verygood很好很ajax'},
        dataType: "json",
        success: function(data){
                    $('#ajaxtest1').val(data.result);
                 }
    });
}
</script>
</head>
<body>
<h2 id="h21">ajax示例</h2>
<div>
<input type="text" id="ajaxtest1" value="" style="width:300px"/>
<input type="button" value="ajax示例1" id="btn1" onclick="ajaxTest1()"/>
</div>
</body>
</html>
